package com.viknix.mysql.demo.controller.mysql;

import com.viknix.common.result.ResultModel;
import com.viknix.mysql.demo.service.MassDataQueryService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Dongqi
 * @Date: 2021/11/5 9:09
 * @Version 1.0
 * @Description:
 */
@AllArgsConstructor
@RestController
@RequestMapping("/mysql")
public class MassDataQueryController {

    private MassDataQueryService massDataQueryService;

    @GetMapping("/generalQuery")
    public ResultModel generalQuery(){
        massDataQueryService.generalQuery();
        return ResultModel.success();
    }

    @GetMapping("/streamQuery")
    public ResultModel streamQuery(){
        massDataQueryService.streamQuery();
        return ResultModel.success();
    }

    @GetMapping("/cursorQuery")
    public ResultModel cursorQuery(){
        massDataQueryService.cursorQuery();
        return ResultModel.success();
    }
}
